package cn.yuanqiao.archive.supervision.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 督察指导档案列表对象 YQSUPERVISION_DA
 * 
 * @author xy
 * @date 2023-08-01
 */
public class SupervisionDa extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_YQSUPERVISION_DA";

    public SupervisionDa() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            throw new ServiceException("tenantCode is null");

        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    /** id */
    @IdAnnotation
    private Long id;

    /** 档案Id */
    @Excel(name = "档案Id")
    private Long daId;

    /** 分表名 */
    @Excel(name = "分表名")
    private String subTableName;

    /** 门类Id */
    @Excel(name = "门类Id")
    private Long categoryId;

    /** 来源 */
    @Excel(name = "来源")
    private String source;

    /** 督察指导Id */
    @Excel(name = "督察指导Id")
    private Long supervisionId;

    /** 创建人Id */
    @Excel(name = "创建人Id")
    private Long createId;

    private String tableName;

    private String type;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setDaId(Long daId) 
    {
        this.daId = daId;
    }

    public Long getDaId() 
    {
        return daId;
    }
    public void setSubTableName(String subTableName) 
    {
        this.subTableName = subTableName;
    }

    public String getSubTableName() 
    {
        return subTableName;
    }
    public void setCategoryId(Long categoryId) 
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId() 
    {
        return categoryId;
    }
    public void setSource(String source) 
    {
        this.source = source;
    }

    public String getSource() 
    {
        return source;
    }
    public void setSupervisionId(Long supervisionId) 
    {
        this.supervisionId = supervisionId;
    }

    public Long getSupervisionId() 
    {
        return supervisionId;
    }
    public void setCreateId(Long createId) 
    {
        this.createId = createId;
    }

    public Long getCreateId() 
    {
        return createId;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("daId", getDaId())
            .append("subTableName", getSubTableName())
            .append("categoryId", getCategoryId())
            .append("source", getSource())
            .append("supervisionId", getSupervisionId())
            .append("createId", getCreateId())
            .append("createTime", getCreateTime())
            .toString();
    }
}
